﻿<?php
class DETECT
{
	/*
	*	Mobile device detection
	*/
	public static function mobile_user_agent() {
		$device = "";
		if(stristr($_SERVER['HTTP_USER_AGENT'],'ipad')) {
			$device = "ipad";
		} else if(stristr($_SERVER['HTTP_USER_AGENT'],'iphone')||strstr($_SERVER['HTTP_USER_AGENT'],'iphone')) {
			$device = "iphone";
		} else if(stristr($_SERVER['HTTP_USER_AGENT'],'blackberry')) {
			$device = "blackberry";
		} else if(stristr($_SERVER['HTTP_USER_AGENT'],'android')) {
			$device = "android";
		} else if(stripos($_SERVER['HTTP_USER_AGENT'],"webOS")) {
			$device = "webOS";
		}
		if(!empty($device)) {
			return $device;
		} else {
			return false;
		}
	}
}
?>